dim ws : set ws = CreateObject("WScript.Shell")
'End Routing
dim varName,varValue,regPath
varName = "Routing"
regPath ="HKEY_CURRENT_USER\Software\MyApp\PADS\" & varName
varValue = ws.RegRead(regPath)

if varValue = 1 then
	varValue = 0
	Application.ExecuteCommand("End Route", , ) 
	Application.ExecuteCommand("End Route", , ) 
	ws.RegWrite "HKEY_CURRENT_USER\Software\MyApp\PADS\" & varName, 0, "REG_EXPAND_SZ"
	Application.StatusBarText ="End routing..."		
else	
		
end if
Application.ExecuteCommand("Cancel")
ws.RegWrite "HKEY_CURRENT_USER\Software\MyApp\PADS\PreviousLayer", -1, "REG_EXPAND_SZ"
ws.RegWrite "HKEY_CURRENT_USER\Software\MyApp\PADS\ActiveLayer", -1, "REG_EXPAND_SZ"
ws.RegWrite "HKEY_CURRENT_USER\Software\MyApp\PADS\IsUnion", 0, "REG_EXPAND_SZ"
ws.RegWrite "HKEY_CURRENT_USER\Software\MyApp\PADS\SPACE", 0, "REG_EXPAND_SZ"
set ws = nothing
